package demo2;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class DataFlowBean implements Writable {
    private Integer up;
    private Integer down;

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeInt(up);
        dataOutput.writeInt(down);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        up = dataInput.readInt();
        down = dataInput.readInt();
    }

    public DataFlowBean() {
    }

    public DataFlowBean(Integer up, Integer down) {
        this.up = up;
        this.down = down;
    }

    public Integer getUp() {
        return up;
    }

    public void setUp(Integer up) {
        this.up = up;
    }

    public Integer getDown() {
        return down;
    }

    public void setDown(Integer down) {
        this.down = down;
    }

    @Override
    public String toString() {
        return "DataFlowBean{" +
                "up=" + up +
                ", down=" + down +
                '}';
    }
}
